<template>
  <yt-page title="避难场所">
    <yt-group :group="false" :searchApi="searchApi">
      <yt-card slot-scope="item" :title="item.name" :tag="false">
        <yt-cell border="none" label="面积/m" :value="item.area"></yt-cell>
        <yt-cell border="none" label="容纳人数/人" labelWidth="150px" :value="item.count"></yt-cell>
        <yt-cell border="none" label="负责人" :value="item.people"></yt-cell>
        <yt-cell border="none" label="联系方式" labelWidth="150px">
          <yt-cell-call :tel="item.mobile || ''"></yt-cell-call>
        </yt-cell>
        <yt-cell border="none" label="位置描述" :value="item.address"></yt-cell>
      </yt-card>
    </yt-group>
  </yt-page>
</template>

<script>
import { commonApi } from '@/common/api/commonApi.js'
export default {
  data() {
    return {
      searchApi: async ({ skip, limit }) => {
        let results = await commonApi.search('yj_refuge', {
          equalTo: { gridId: this.$route.query.gridId },
          skip,
          limit
        })
        return results
      }
    }
  }
}
</script>

<style scoped lang="stylus">
>>>.yt-cell-label
  padding 0
</style>
